using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration; using Sispe.Entities;

namespace Sispe.Repository.Mapping
{
    public class RURALMap : EntityTypeConfiguration<RURAL>
    {
        public RURALMap()
        {
            // Primary Key
            this.HasKey(t => t.IdRural);

            // Properties
            this.Property(t => t.CentroPoblado)
                .IsRequired()
                .HasMaxLength(20);

            this.Property(t => t.Caserio)
                .IsRequired()
                .HasMaxLength(20);

            // Table & Column Mappings
            this.ToTable("RURAL");
            this.Property(t => t.IdRural).HasColumnName("IdRural");
            this.Property(t => t.CentroPoblado).HasColumnName("CentroPoblado");
            this.Property(t => t.Caserio).HasColumnName("Caserio");
        }
    }
}
